package com.hjxy.service.impl;

import com.hjxy.dao.CollegeDao;
import com.hjxy.pojo.College;
import com.hjxy.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollegeServiceImpl implements CollegeService {

    @Autowired
    private CollegeDao collegeDao;

    @Override
    public int addCollege(College college) {
        int i = collegeDao.addCollege(college);
        System.out.println(college.getCollegeId()+"----id");
        System.out.println(college.getCollegeName()+"------name");
        return i;
    }

    @Override
    public List<College> queryCollege() {
        return collegeDao.queryCollege();
    }

    @Override
    public int updateCollege(College college) {
        return collegeDao.updateCollege(college);
    }

    @Override
    public College queryOneCollegeById(int collegeId) {
        College college = collegeDao.queryOneCollegeById(collegeId);
        System.out.println("collegeDao.queryOneCollegeById(collegeId)==>"+college);
        return college;
    }

    @Override
    public int deleteOneCollege(int collegeId) {
        return collegeDao.deleteOneCollege(collegeId);
    }
}
